{% extends "_layouts/default.html" -%}
{% block content -%}
<div class="about_con">  
    <form action="?action=add" method="post" name="submitform" id="submitform">
    <table width="650" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="45">&nbsp;</td>
            <td width="605">
                <table align="center" border="0" cellpadding="2" cellspacing="0" class="t9" width="96%">
                    <tbody>
                        <tr> 
                            <td width="17%" class="12"><font color="#00000">标题名称:</font></td>
                            <td width="83%" height="30" align="left">
                                <b><font size="2"> <span class="unnamed1"> <input class="inpu2" maxlength="256" name="name" size="35" /> </span></font></b>
                                <span class="unnamed1"><font color="#ff0000">*</font></span>
                            </td>
                        </tr>

                        <tr> 
                            <td width="17%" class="12"><font color="#000000">地址:</font></td>
                            <td width="83%" height="30" align="left"><span class="unnamed1"><b><font size="2"><span class="unnamed1"> <input class="inpu2" maxlength="256" name="add" size="50" /> </span></font></b></span></td>
                        </tr>

                        <tr> 
                            <td width="17%" class="12"><font color="#000000">联系人:</font></td>
                            <td width="83%" height="30" align="left"><font size="2"><span class="unnamed1"><b><font size="2"><span class="unnamed1"> <input class="inpu2" maxlength="256" name="lxr" /> </span></font></b><font size="2"><span class="unnamed1"><font color="#ff0000">*</font></span><b><span class="unnamed1"> </span></b></font></span></font></td>
                        </tr>
                        <tr> 
                            <td width="17%" class="12"><font color="#000000">E-mail:</font></td>
                            <td width="83%" height="30" align="left"><b><font size="2"><span class="unnamed1"> <input class="inpu2" maxlength="256" name="femail" size="30" /> </span></font></b><span class="unnamed1"><font color="#ff0000">*</font></span></td>
                        </tr>

                        <tr> 
                            <td width="17%" class="12"><font color="#000000">电话:</font></td>
                            <td width="83%" height="30" align="left"><font size="2"><span class="unnamed1"> <input class="inpu2" maxlength="256" name="tel" size="25" /> </span></font><span class="unnamed1"><font color="#ff0000">*</font></span></td>
                        </tr>
                        <tr> 
                            <td width="17%" class="12"><font color="#000000">传真:</font></td>
                            <td width="83%" height="30" align="left"><span class="unnamed1"><b><font size="2"><span class="unnamed1"> <input class="inpu2" maxlength="256" name="fax" size="25" /> </span></font></b><font size="2"><span class="unnamed1"><font color="#ff0000">*</font></span><b><span class="unnamed1"> </span></b></font></span></td>
                        </tr>
                        <tr> 
                            <td width="17%" class="12"><font color="#00000">备注信息:</font></td>
                            <td width="83%" align="left"><b><font size="2"><span class="unnamed1"> <textarea class="inpu2" cols="55" name="contact" rows="5" wrap="VIRTUAL"></textarea> </span></font></b></td>
                        </tr>

                        <tr> 
                            <td width="17%">&nbsp;</td>
                            <td width="83%" align="left"> <input name="tHtml" type="hidden" /> <input name="button2" type="button" class="input2" onClick="javascript:check();" value="提交留言" /> <input name="重来2" type="reset" class="input2" value="重新填写" /></td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </table>
    </form>
</div>
<div class="con_page clearfix"></div>
<!--推荐信息-->
<script language="JavaScript" type="text/JavaScript">
function isEmail(vEMail) {
    var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
    return (!regInvalid.test(vEMail)&&regValid.test(vEMail));
}

function check() {
    if (document.submitform.name.value == "") {
        alert("请输入公司名称");
        document.submitform.name.focus();
        return (false);
    }
    if (document.submitform.lxr.value == "") {
        alert("请输入您的姓名以便联系！");
        document.submitform.lxr.focus();
        return (false);
    }
    if (document.submitform.femail.value == "") {
        alert("请输入您的电子邮件地址");
        document.submitform.femail.focus();
        return (false);
    }

    if (!(document.submitform.femail.value == "")) {
        var checkStr = document.submitform.femail.value;
        var allValid = false;
        for (i = 0;  i < checkStr.length;  i++) {
            ch = checkStr.charAt(i);
            if (ch =="@") allValid =true;
        }
        if  (!allValid) {   
            alert("请输入正确的Email格式!");
            document.submitform.femail.focus();
            return (false); 
        }
    }

    if (document.submitform.tel.value == "") {
        alert("请输入您的电话");
        document.submitform.tel.focus();
        return (false);
    }
    if (document.submitform.fax.value == "") {
        alert("请输入您的传真！");
        document.submitform.fax.focus();
        return (false);
    }
    if  (!(isEmail(document.submitform.femail.value ))) {
        alert("您的信息发送成功");
        return false;
    } else {  
        document.submitform.tHtml.value=document.submitform.innerHTML; 
        document.submitform.submit();
    }
}
</script>
{% endblock content -%}
